//
//  MyTableViewCell.m
//  Interface
//
//  Created by Letme on 15-4-15.
//  Copyright (c) 2015年 zhenjiea. All rights reserved.
//

#import "MyTableViewCell.h"

@implementation MyTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}
- (void)createCell
{
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.myImageVeiw = [[UIImageView alloc] initWithFrame:CGRectMake(5, 10, self.contentView.frame.size.width / 3, self.contentView.frame.size.width / 3)];
    //self.myImageVeiw.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.myImageVeiw];
    
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width / 3 + 10, 10, self.contentView.frame.size.width / 3 * 2 - 10, 30)];
    [self.contentView addSubview:self.nameLabel];
    //self.nameLabel.backgroundColor = [UIColor redColor];
    [_nameLabel release];
    
    self.reasonLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width / 3 + 10, 50, self.contentView.frame.size.width / 3 * 2 - 10, 30)];
    self.reasonLabel.numberOfLines = 0;
    self.reasonLabel.font = [UIFont systemFontOfSize:12.0];
    [self.contentView addSubview:self.reasonLabel];
    //self.reasonLabel.backgroundColor = [UIColor cyanColor];
    [_reasonLabel release];
    
    self.visited_countLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width / 3 + 10, 80, self.contentView.frame.size.width / 3 * 2 - 10, 30)];
    [self.contentView addSubview:self.visited_countLabel];
    self.visited_countLabel.font = [UIFont systemFontOfSize:12.0];
    //self.visited_countLabel.backgroundColor = [UIColor lightGrayColor];
    [_visited_countLabel release];
    
}
- (void)setMyModel:(HotsiteListModel *)myModel
{
    
    self.nameLabel.text = myModel.name;
    self.reasonLabel.text =myModel.recommended_reason;
    self.visited_countLabel.text = [NSString stringWithFormat:@"%@人去过", myModel.visited_count];
   // NSURL *url = [NSURL URLWithString:model.imageUrl];
   // [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"User_Profiles_bg.png"]];
    NSURL *url = [NSURL URLWithString:myModel.cover_route_map_cover];
    [self.myImageVeiw sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"06b1OOOPICf5.jpg"]];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
